<?php

class City extends Eloquent{
	protected $table = 'cities';
	public $timestamps = false;
	
	public function country(){
		$country = $this->belongsTo('Country','country_id');
		return $country!=null? $country:null;
	}

	public function hometownOfUsers(){
		$usersInformations = $this->hasMany('UserInformation','hometown_city_id');
		return $usersInformations!=null?$usersInformations : null;
	}

	public function currentCityOfUsers(){
		$usersInformations = $this->hasMany('UserInformation','current_city_id');
		return $usersInformations!=null?$usersInformations : null;
	}

	public function districts(){
		$usersInformations = $this->hasMany('District','city_id');
		return $usersInformations!=null?$usersInformations : null;
	}
}